package cn.changeforyou.analyzer.javaparse;

import cn.changeforyou.utils.cons.DateTimeUtils;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import lombok.experimental.Accessors;

/**
 * Order对象
 *
 * @author xwy
 * @since 2020-12-16
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Accessors(chain = true)
@TableName("oms_order")
@ApiModel(value = "Order对象", description = "")
public class Order extends SuperModel<Order> {

    private static final long serialVersionUID = 1L;

    /**
     * 订单状态：骑手已接单
     */
    public static final Integer OR_STATUS_DELIVERYMAN_RECEIVED = 1;

    /**
     * 骑手配送状态：新订单
     */
    public static final Integer DM_STATUS_NEW_ORDER = 0;

    /**
     * 骑手配送状态：已接单
     */
    public static final Integer DM_STATUS_RECEIVED = 1;

    /**
     * 骑手配送状态：已到店
     */
    public static final Integer DM_STATUS_ARRIVED = 2;

    /**
     * 骑手配送状态：已取餐(配送中)
     */
    public static final Integer DM_STATUS_DELIVERING = 3;

    /**
     * 骑手配送状态：已送达
     */
    public static final Integer DM_STATUS_HAND = 4;

    /**
     * 订单状态：已取消
     */
    public static final Integer ORDER_STATUS_REFUND_SIGN = -1;

    /**
     * 订单状态：新订单
     */
    public static final Integer ORDER_STATUS_NEW_ORDER = 0;

    /**
     * 订单状态：支付成功
     */
    public static final Integer ORDER_STATUS_SUCCESS_PAY = 1;

    /**
     * 订单状态：商家接单
     */
    public static final Integer ORDER_STATUS_SHOP_RECEIVED = 2;

    /**
     * 订单状态：骑手已接单
     */
    public static final Integer ORDER_STATUS_DM_RECEIVED = 3;

    /**
     * 订单状态：骑手已到店
     */
    public static final Integer ORDER_STATUS_DM_ARRIVED_SHOP = 4;

    /**
     * 订单状态：配送中
     */
    public static final Integer ORDER_STATUS_DM_DELIVERING = 5;

    /**
     * 订单状态：已送达
     */
    public static final Integer ORDER_STATUS_USER_RECEIVED = 6;

    /**
     * 订单状态：已完成
     */
    public static final Integer ORDER_STATUS_FINISH = 7;

    /**
     * 订单状态中的商家状态 : 新订单
     */
    public static final Integer SHOP_STATUS_NEW = 0;
    /**
     * 订单状态中的商家状态 : 备餐中
     */
    public static final Integer SHOP_STATUS_READYING = 1;
    /**
     * 订单状态中的商家状态 : 待出餐
     */
    public static final Integer SHOP_STATUS_WAIT = 2;
    /**
     * 订单状态中的商家状态 : 已出餐
     */
    public static final Integer SHOP_STATUS_FINISH_FOOD = 3;

//--------------------------------------------------  支付类型常量
    /**
     * 未支付, 也是数据库默认值
     */
    public static final Integer PAY_TYPE_UNPAIED = 0;
    /**
     * 支付宝支付
     */
    public static final Integer PAY_TYPE_ZHIFUBAO = 1;
    /**
     * 微信支付
     */
    public static final Integer PAY_TYPE_WX = 2;

    //---------------------------


    @ApiModelProperty(value = "订单编号 8位日期+2位平台号码+2位支付方式+6位随机数")
    private String orderNumber;

    @ApiModelProperty(value = "顾客id")
    private String userId;

    @ApiModelProperty(value = "下单用户电话")
    @TableField(exist = false)
    private String orderPhone;

    @ApiModelProperty(value = "商品总原价 商品orign_price相加")
    private BigDecimal foodPrice;

    @ApiModelProperty(value = "红包id")
    private String redEnvelopeId;

    @ApiModelProperty(value = "红包金额")
    private BigDecimal redEnvelopePrice;

    @ApiModelProperty(value = "打包费")
    private BigDecimal packagePrice;

    @ApiModelProperty(value = "配送费")
    private BigDecimal deliveryPrice;

    @ApiModelProperty(value = "实际金额(订单实际该支付总额)")
    private BigDecimal actualPrice;

    @ApiModelProperty("平台获得得金钱, 已提成 金钱有正负, 正数代表进账, 负数代表出账")
    private BigDecimal platformShouldGetSignedMoney;

    @ApiModelProperty("商家获得得金钱, 已提成 金钱有正负, 正数代表进账, 负数代表出账")
    private BigDecimal shopShouldGetSignedMoney;

    @ApiModelProperty("平台活动补贴金额")
    private BigDecimal platformActivityAllowance;

    @ApiModelProperty(value = "收货人姓名")
    private String cneeName;

    @ApiModelProperty(value = "收货人性别（0：女士，1：先生）")
    private Integer cneeSex;

    @ApiModelProperty(value = "收货地址")
    private String cneeAddress;

    @ApiModelProperty(value = "收货手机号")
    private String cneePhone;

    @ApiModelProperty(value = "订单状态（-1：退款标记，0：订单已提交，1：支付成功，2：商家已接单，3：骑手已接单，4：骑手已到店:，5：配送中，6：商品已送达，7订单已完成）")
    private Integer orderStatus;

    @ApiModelProperty(value = "订单商家状态（-1：退款标记，0：新订单，1：备餐中，2：待出餐，(已做好, 骑手还没取走)3：已出餐(骑手已取走)）")
    private Integer shopStatus;

    @ApiModelProperty(value = "订单骑手状态（-1：退款标记，0：新订单，1：已接单，2：已到店，3：配送中，4：已送达）")
    private Integer deliveryStatus;

    @ApiModelProperty(value = "是否评论（0：否，1：是）")
    private Integer reviewStatus;

    /**
     * {@link this#PAY_TYPE_UNPAIED}
     * {@link this#PAY_TYPE_WX}
     * {@link this#PAY_TYPE_ZHIFUBAO}
     * 等常量
     */
    @ApiModelProperty(value = "支付方式：0->未支付；1->支付宝；2->微信, 默认值0")
    private Integer payType;

    @JsonFormat(pattern = DateTimeUtils.DATE_TIME_STANDARD_FORMATE_STR, timezone = "GMT+8")
    @ApiModelProperty(value = "支付时间")
    private String payTime;

    @ApiModelProperty(value = "订单来源：0->小程序订单；1->app订单")
    private Integer sourceType;

    @ApiModelProperty(value = "店铺id")
    private String shopId;

    @ApiModelProperty("店铺名称")
    private String shopName;

    @ApiModelProperty(value = "店铺地址")
    private String shopAddress;

    @ApiModelProperty(value = "店铺经度")
    private Double shopLongitude;

    @ApiModelProperty(value = "店铺纬度")
    private Double shopLatitude;

    @ApiModelProperty(value = "取餐号（取某店铺今日内的上一笔订单的取餐号+1，如无从1开始计数）")
    private Long getNumber;

    @ApiModelProperty(value = "配送员id")
    private String deliverymanId;



    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "餐具数量（0-10份，11份为10份以上）")
    private Integer tableware;



}
